package cn.hchaojie.spring.day01;

import java.text.DateFormat;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import cn.hchaojie.spring.day01.beans.CategoryService;
import cn.hchaojie.spring.day01.beans.PostService;
import cn.hchaojie.spring.day01.config.AppConfig;

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = {AppConfig.class})
public class Demo6SpringJavaConfig {
	@Autowired
	PostService service;
	
	@Autowired
	DateFormat formatter;
	
	@Autowired
	CategoryService categoryService;
	
	@Test
	public void test1() {
		System.out.println(service);
	}
	
	@Test
	public void test2() {
		service.formatDate();
		
		System.out.println(formatter == service.getFormmater());
	}
}
